import subprocess
from subprocess import PIPE

ping_result = subprocess.Popen("ping -q -c 3 192.168.143.1",stdout=subprocess.PIPE)
ping_result = ping_result.stdout.readlines()
result = b"".join(ping_result).decode("gbk")

print(result)